<template>
	<view class="ALL">
		<image :src="bg" mode=""></image>
		<view class="box">
			<view class="top">
				<text>账号信息</text>
			</view>
			<view class="mid">
				<view class="mid-section">
					<!-- <text>手机号码</text> -->
					<input type="text" value="" @input="Phone" placeholder="请输入手机号码" />
				</view>
				<view class="mid-section">
					<!-- <text>用户名</text> -->
					<input type="text" value="" @input="Name" placeholder="请输入用户名" />
				</view>
				<view class="mid-section">
					<!-- <text>账号邮箱</text> -->
					<input type="text" value="" @input="Emil" placeholder="账号邮箱" />
				</view>
				<view class="mid-section">
					<!-- <text>密码</text> -->
					<input type="text" value="" @input="passWord" placeholder="请设置密码" />
				</view>
				<view class="mid-section">
					<!-- <text>密码确认</text> -->
					<input type="text" @blur="Listeningfocus('S',index)" value="" @input="passWordsure" placeholder="请确认密码" />
				</view>
			</view>
			<view class="ensure" @tap="next">
				<text>下一页</text>
			</view>
		</view>

	</view>
</template>

<script>
	import apis from '../../api.js'
	import icons from "../../common/icons.js"
	export default {
		data() {
			return {
				userPhone: '',
				userName: '',
				userMailbox: '',
				userPassword: '',
				passwordsure: '',
				deferent:'',
				bg:icons.icons.bg,
			}
		},
		methods: {
			Phone(e) {
				console.log(e.detail.value)
				this.userPhone = e.detail.value
			},
			Name(e) {
				console.log(e.detail.value)
				this.userName = e.detail.value
			},
			Emil(e) {
				console.log(e.detail.value)
				this.userMailbox = e.detail.value
			},
			passWord(e) {
				console.log(e.detail.value)
				this.userPassword = e.detail.value
			},
			passWordsure(e) {
				console.log(e.detail.value)
				this.passwordsure = e.detail.value
			},
			Listeningfocus(type, index) {
				if (type == 'S') {
					if(this.passwordsure!==this.userPassword){
						uni.showToast({
							title:'密码不相同',
							icon:'none'
						})
						this.deferent=false
					}
					else{
						this.deferent=true
					}
				}
			},
			next() {
				console.log(this.deferent)
				if(this.deferent==false){
					uni.showToast({
						title:'密码不相同',
						icon:'none'
					})
				}else{
					uni.navigateTo({
					url: '../companyRegister/companyRegister?userPhone=' + this.userPhone + '&userName=' + this.userName +
						'&userMailbox=' + this.userMailbox + '&userPassword=' + this.userPassword
				})
				}
				
			}
		}
	}
</script>

<style scoped>
	.ALL {
		width: 100%;
		display: flex;
		justify-content: center;
	}

	.ALL>image {
		width: 100%;
		height: 100%;
		position: fixed;
		top: 0;
		z-index: -1;
	}

	.box {
		width: 686rpx;
		height: 938rpx;
		margin-top: 200rpx;
		background: #FFFFFF;
		border-radius: 12rpx;
		display: flex;
		flex-direction: column;
		/* justify-content: center; */
		align-items: center;
	}

	.top {
		width: 100%;
		margin-top: 60rpx;
		text-align: center;
	}

	.top>text {
		font-size: 36rpx;
		font-family: PingFangSC-Medium, PingFang SC;
		font-weight: 1000;
		color: #212121;
	}

	.mid-section {
		width: 624rpx;
		height: 130rpx;
		display: flex;
		align-items: center;
		border-bottom: 2rpx solid #E6E9EE;
	}

	.mid-section>input {
		margin-top: 40rpx;
	}

	.ensure {
		width: 624rpx;
		height: 88rpx;
		background: #000000;
		border-radius: 12rpx;
		color: #B6914E;
		text-align: center;
		line-height: 88rpx;
		font-size: 36rpx;
		font-family: PingFangSC-Semibold, PingFang SC;
		font-weight: 1000;
		margin-top: 60rpx;
	}
</style>
